﻿using System;
using System.Runtime.Serialization;

namespace Director.DomainModels
{
	[DataContract]
	public class TimeFrame : Identifiable
	{
		public enum ELength
		{
			M1 = 60,
			M5 = M1 * 5,
			M15 = M5 * 3,
			H1 = M15 * 4,
			D1 = H1 * 24,
			W1 = D1 * 7,
		}

		[DataMember]
		public TimeSpan Length { get; set; }

		[DataMember]
		public int TimeFrameLength { get; private set; }

		public ELength TimeFrameELength { get { return (ELength)TimeFrameLength; } }

		public override string ToString()
		{
			return ((ELength) TimeFrameLength).ToString();
		}
	}
}